package com.jxs.android.weiget;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.widget.TextView;

public class ReportCell extends TextView {
	private String typeMenu;
	private String typeItem;
	private boolean isSelfClick = false;
	private Paint mPaint;

	private String proId;
	private String title;
	private String columnName;

	public ReportCell(Context context) {
		super(context);
		mPaint = new Paint();
		mPaint.setStyle(Paint.Style.STROKE);
		mPaint.setColor(Color.rgb(0x00, 0x00, 0x00));
		mPaint.setAntiAlias(true);
	}

	public void setLinkLineWhitle() {
		mPaint.setColor(Color.rgb(0xFF, 0xFF, 0xFF));
	}

	public String info() {
		return typeMenu + "-" + typeItem;
	}

	public void setTypeMenu(String typeMenu) {
		this.typeMenu = typeMenu;
	}

	public String getTypeMenu() {
		return typeMenu;
	}

	public void setTypeItem(String typeItem) {
		this.typeItem = typeItem;
	}

	public String getTypeItem() {
		return typeItem;
	}

	public void setSelfClick(boolean isSelfClick) {
		this.isSelfClick = isSelfClick;
	}

	public boolean isSelfClick() {
		return isSelfClick;
	}

	public String getProId() {
		return proId;
	}

	public void setProId(String proId) {
		this.proId = proId;
	}

	public String getColumnName() {
		return columnName;
	}

	public void setColumnName(String columnName) {
		this.columnName = columnName;
	}

	@Override
	protected void onDraw(Canvas canvas) {
		super.onDraw(canvas);
		if (isSelfClick) {
			int pointY = getBaseline() + 6;
			float width = getTextSize() * getText().length();
			int offSetX = (int) ((getWidth() - getPaddingLeft() - getPaddingRight() - width) / 2);
			canvas.drawLine(offSetX + getPaddingLeft(), pointY, offSetX + getPaddingLeft() + width, pointY, mPaint);
		}
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getTitle() {
		return title;
	}

}
